<span>{{ $stock }}</span>
@if ($status !== 2 && !prod() && $plug === 0)
    <a href="#" class="grid-row-view" data-toggle="modal" data-target="#spec_stock_list{{ $id }}">
        修改库存
    </a>
    <div class="modal fade" id="spec_stock_list{{ $id }}" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                </div>
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>规格信息</th>
                            <th>当前库存</th>
                            <th>库存増减</th>
                            <th>改后库存</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($specs as $v)
                            <tr class="stock-tr-list{{ $serialNumber }}">
                                <td class="spec-info">
                                    <input class="ps_id" type="hidden" value="{{ $v->ps_id }}">
                                    <input class="old_stock" type="hidden" value="{{ $v->ps_usable_stock }}">

                                    <img src="{{ fileIdToUrl($v->ps_avatar ?? $defaultImg) }}" width="30"
                                        alt="">
                                    <span>ID:{{ $v->serial_number }}<br />{{ $v->ps_name }}</span>
                                </td>
                                <td>{{ $v->ps_usable_stock }}</td>
                                <td>
                                    <div class="input-group">
                                        <span class="input-group-btn">
                                            <button class="btn btn-default sub-btn" type="button"
                                                onclick="editStock(this, 'sub')">减</button>
                                        </span>
                                        <input type="text" class="form-control edit-stock-input"
                                            onfocus="checkInteger(this)" onkeyup="checkInteger(this)"
                                            oninput="editStock(this, 'inputChange')">
                                        <span class="input-group-btn">
                                            <button class="btn btn-default add-btn" type="button"
                                                onclick="editStock(this, 'add')">增</button>
                                        </span>
                                    </div>
                                </td>
                                <td>
                                    <input type="text" class="form-control current-stock"
                                        value="{{ $v->ps_usable_stock }}" onfocus="checkInteger(this)"
                                        onkeyup="checkInteger(this)" oninput="editStock(this, 'stockChange')">
                                </td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary"
                        onclick="saveEditStock('{{ $serialNumber }}','{{ $newAuth }}')">提交
                    </button>
                </div>
            </div>
        </div>
    </div>
@endif
